home *** CD-ROM | disk | FTP | other *** search
/ Risc World 3 / Risc World 3.iso / SOFTWARE / ISSUE3 / POWERBASE / DOCS / Ch09-Merge < prev    next >
Text File  |  2001-01-29  |  8KB  |  156 lines

  1. ===============================================
  2. Ch 9 − Mail-Merging with Impression and Ovation
  3. ===============================================                                               
  4.  
  5. Although the title refers to “Mail-Merging” the process to be described is
  6. more accurately termed “Data-Merging” as it is by no means limited to
  7. merging names and addresses into letters or labels; any kind of textual data
  8. from a Powerbase application can be merged into any kind of document in
  9. Impression or Ovation or many other editors and wordprocessors. 
  10.  
  11. 9.1     Mail-merging with Ovation
  12. ---------------------------------
  13. Ovation expects data for merging to be supplied as a CSV file. An example
  14. file (OvationCSV) is supplied with this version of Powerbase. It was created
  15. from the Elements database and is intended to work with the sample Ovation
  16. document OmergeTest. Before attempting to create CSV files of your own you
  17. are recommended to read the Powerbase documentation on such files (see Ch
  18. 8). The process for mail-merging with Ovation is described below. 
  19.  
  20. 9.1.1   Preparing an Ovation document for mail-merging
  21.  
  22. Ovation has a very easy method of specifying where the merged data is to go
  23. into the document. Whenever you reach a point where you wish to insert a
  24. Powerbase field type Ctrl I.  A window headed “Merge tag” will appear
  25. inviting you to enter a number. The number required is the field number in
  26. the CSV record (which is not necessarily the field number in the Powerbase
  27. record). If, for instance, you wish to merge the second field from each line
  28. of your CSV file enter 2 and type Return. You will see that “[Merge2]” has
  29. been inserted into the text at the caret. Continue typing, inserting other
  30. fields as required. The fields do not need to be in numerical order (you can
  31. insert field 2 before you insert field 1) and the same field may be inserted
  32. many times. Styles and effects may be applied to the Merge tags. Load
  33. OmergeTest to see how this looks. 
  34.  
  35. 9.1.2   Merging the data from Powerbase
  36.  
  37. With OmergeTest loaded, open the main Ovation menu, go to the File submenu
  38. and choose Print. Select the Mail merge option button and drag OvationCSV to
  39. the writable icon to the right of the button. The pathname of the file will
  40. appear in the icon. Click on OK and the document will be printed once for
  41. each record in the CSV file, merging new data into the document each time.
  42. OvationCSV contains 10 records so if you just want to see the process in
  43. action without actually printing 10 sheets of paper set your printer manager
  44. to print to a file instead of to the printer itself. 
  45.  
  46. If you examine OvationCSV you will see that each field is enclosed in
  47. quotes. This is only necessary of the fields contain literal commas (see
  48. 8.1). Look at the first record, for example, and note the comma in
  49. “(Gr.aktis,aktinos; ray or beam)”. Without the quotes Ovation would
  50. interpret the comma as a field separator and the merging would get out of
  51. step for that record. 
  52.  
  53. 9.2     Mail-merging with Impression
  54. ------------------------------------
  55. The following description applies to Impression Publisher and Impression
  56. Style. The older ImpressionII is also supported. Powerbase and Impression
  57. are able to communicate directly with each other without the need for a CSV
  58. file. This task is performed by a module called ImpulseII which Computer
  59. Concepts have placed in the public domain to encourage its adoption as a
  60. standard means of transferring data between RISC OS applications. The
  61. ImpulseII module is included in the !Powerbase.Resources.Modules directory. 
  62.  
  63. 9.2.1   Preparing the Impression document 
  64.  
  65. Since the merged data is not being supplied from a pre-generated CSV file
  66. Impression needs to request specifically each Powerbase field that it wants
  67. to merge into the document. It is probably best to create the document
  68. without worrying about the merged data at first, then insert the necessary
  69. commands afterwards.
  70.  
  71. Wherever you want data from a Powerbase record to appear in the document
  72. proceed as follows:
  73.  
  74. (1)     Place the caret at the point where the data is to be inserted.
  75.  
  76. (2)     Click MENU over the frame, go to the Utilities  submenu (Misc in
  77.         ImpressionII) and choose Merge command.  A dialogue box will appear.
  78.  
  79.                                 - 48 - 
  80.  
  81. (3)     Type the following:
  82.  
  83.         :Powerbase GetField NAME 
  84.  
  85. This is on the understanding that your Powerbase record contains a field
  86. whose tag is NAME and that you want the contents of that field inserting
  87. into the Impression document at that point. Note the spaces and the initial
  88. colon. These are essential. 
  89.  
  90. (4)     Click on Set or type Return. You will see “<NAME>” appear in the
  91.         text. 
  92.  
  93. (5)     Repeat for all the other Powerbase fields to be inserted in the
  94.         document. All take the form:− 
  95.  
  96.         :Powerbase GetField <tag>
  97.  
  98. and in each case the tag, enclosed in angle brackets, will appear in the
  99. text. All the data in a given document must come from the same database. It
  100. might be easiest if you open the required database and arrange the desktop
  101. so that you can see both the record window and the Impression document.
  102. Clicking MENU over a field makes its tag appear in the second item of the
  103. main Powerbase menu. Copy it exactly into the Merge command window.
  104.  
  105. (6) Save the the document! 
  106.  
  107. 9.2.2   Merging the data
  108.  
  109. (1)     Make sure Impression has been “seen” by the filer then open the
  110.         Powerbase database.      
  111.  
  112. (2)     Drop the Impression document on the record window.  The document
  113.         will be loaded and displayed then Powerbase’s Data Merge window will
  114.         appear.  (If Impression isn’t already running Powerbase will run it
  115.         for you.)
  116.  
  117. (3)     Clicking on Merge extracts data from either the first record or, if
  118.         the Merge from displayed record switch is set, the
  119.         currently-displayed record, and inserts it in the specified places
  120.         in the Impression document. You can see this happening if the
  121.         relevant parts of the document are visible. Using the keypad to
  122.         browse, search or change subfiles or keys now causes the accessed
  123.         records to be merged into the document instead of being displayed in
  124.         the record window.  If a filter (see 2.3.3) is active this will also
  125.         be obeyed.  Each time a record is merged its data overwrites that
  126.         from the previous record. 
  127.  
  128. (4)     If your printer is on-line and the printer driver loaded you may
  129.         print the document with the merged data by clicking on Print.  If
  130.         the Print all switch is selected before Merge is clicked Powerbase
  131.         will proceed through the database from whichever record you first
  132.         merged, merging each record in turn (or each matching record if a
  133.         filter is in use) and printing for each record a copy of the
  134.         document containing the merged data.
  135.  
  136. Note that when the mouse pointer is moved over the Impression document with
  137. the merged data present it changes to a large red and blue cross which means
  138. that you cannot edit the document. Clicking SELECT over it has no effect;
  139. the caret doesn’t appear. If you click on Cancel in the Data merge window
  140. the merged data is removed from the document and normal editing is restored.
  141. If you do want to edit the document with merged data present then click on
  142. Edit. Note, however, that if you save the document in this state it will be
  143. saved with the specific data you have merged into it rather than with the
  144. commands to merge data. Appendix A gives a full description of the Impulse
  145. commands or “methods” which Powerbase understands.
  146.  
  147. 9.3     Mail-merging with other programs
  148. ----------------------------------------
  149. If you use neither Impression nor Ovation you may still be able to use
  150. mail-merging with your wordprocessor, but you will need to read the manual
  151. carefully to find out how. It will almost certainly involve a CSV, or
  152. similar, file in conjunction with some method of “tagging” the document (as
  153. described above for Impression and Ovation) to specify where in it the data
  154. is to be merged.
  155.  
  156.                                 - 49 -